import time

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions
from selenium.webdriver.support.wait import WebDriverWait

if __name__ == '__main__':
    url1 = "https://www.baidu.com"
    url2 = "https://www.jd.com"
    url3 = "https://www.taobao.com"

    executable_path = "../drivers/chromedriver.exe"

    service = Service(executable_path=executable_path)
    browser = webdriver.Chrome(service=service)

    browser.get(url=url1)
    time.sleep(10)
    browser.get(url=url2)
    time.sleep(10)
    browser.get(url=url3)
    time.sleep(10)

    # 浏览器后退页面
    browser.back()
    time.sleep(5)
    # 浏览器前进
    browser.forward()
    time.sleep(5)

    browser.quit()
